package com.kakarote.core.feign.hrm;

import com.kakarote.core.common.Result;
import com.kakarote.core.feign.hrm.impl.HrmFeignServiceImpl;
import com.kakarote.core.feign.oa.entity.ExamineVO;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "hrm", contextId = "hrmService", fallback = HrmFeignServiceImpl.class)
public interface HrmFeignService {
    /**
     * 查询HRM审批，返回Map
     * @param hrmExamineIds:hrm审批id
     * @return
     */
    @PostMapping("/hrm/examine/getMapByIds")
    Result<Map<Long, ExamineVO>> getHrmExamineByIds(@RequestParam("hrmExamineIds") List<Long> hrmExamineIds);
    /**
     * 完成入职流程
     */
    @PostMapping("/hrm/examine/finishEntryExamine")
    Result<Void> finishEntryExamine(@RequestParam("hrmExamineId") Long hrmExamineId, @RequestParam("checkStatus") Integer checkStatus);

    /**
     * 完成离职流程
     */
    @PostMapping("/hrm/examine/finishLeaveExamine")
    Result<Void> finishLeaveExamine(@RequestParam("hrmExamineId") Long hrmExamineId, @RequestParam("checkStatus") Integer checkStatus);
    /**
     * 流程引用调入流程
     */
    @PostMapping("/hrm/examine/saveEmpChangeInExamine")
    Result<Void> saveEmpChangeInExamine(@RequestParam("flowId") Long flowId,@RequestParam("recordId") Long recordId);
    /**
     * 流程引用调出流程
     */
    @PostMapping("/hrm/examine/saveEmpChangeOutExamine")
   Result<Void> saveEmpChangeOutExamine(@RequestParam("flowId") Long flowId,@RequestParam("recordId") Long recordId);
    /**
     * 人员调动
     */
    @PostMapping("/hrm/examine/finishEmployeeChange")
    Result<Void> finishEmployeeChange(@RequestParam("hrmExamineId") Long hrmExamineId, @RequestParam("checkStatus") Integer checkStatus);

    /**
     * 当子级完成之后
     * @param hrmExamineId
     * @param checkStatus
     * @return
     */
    @PostMapping("/hrm/examine/finishChildrenFlow")
    Result<Void> finishChildrenFlow(@RequestParam("hrmExamineId") Long hrmExamineId, @RequestParam("checkStatus") Integer checkStatus);
    /**
     * 子级完成后，最好碰到最后一个节点，将父节点完结,这种情况，不会出现拒绝的情形
     */
    @PostMapping("/hrm/examine/finishParentFlow")
    Result<Void> finishParentFlow(@RequestParam("hrmExamineId") Long hrmExamineId,@RequestParam("checkStatus") Integer checkStatus);

    /**
     * 保存员工入职-集团流程
     */
    @PostMapping("/hrm/examine/saveEmpEntryGroupExamine")
    Result<Void> saveEmpEntryGroupExamine(@RequestParam("flowId") Long flowId,@RequestParam("recordId") Long recordId);
    /**
     * 完成员工入职-集团流程
     */
    @PostMapping("/hrm/examine/finishGroupEntryExamine")
    Result<Void> finishGroupEntryExamine(@RequestParam("hrmExamineId") Long hrmExamineId,@RequestParam("checkStatus") Integer checkStatus);
    /**
     * 员工信息修改审批流程
     */
    @PostMapping("/hrm/examine/finishEmployeeInfoChangeExamine")
    Result<Void> finishEmployeeInfoChangeExamine(@RequestParam("hrmExamineId") Long hrmExamineId, @RequestParam("checkStatus") Integer checkStatus);
    /**
     * 员工关键字段修改审批流程
     */
    @PostMapping("/hrm/examine/finishEmployeeKeyFieldChangeExamine")
    Result<Void> finishEmployeeKeyFieldChangeExamine(@RequestParam("hrmExamineId") Long hrmExamineId, @RequestParam("checkStatus") Integer checkStatus);
    /**
     * 员工职务层级调整审批流程
     */
    @PostMapping("/hrm/examine/finishEmployeePostLevelChangeExamine")
    Result<Void> finishEmployeePostLevelChangeExamine(@RequestParam("hrmExamineId") Long hrmExamineId, @RequestParam("checkStatus") Integer checkStatus);
}
